The point of differences between procedure and function are as follows:
1. A function has a return type, while procedure does not have any return type.However ,If needed, the data can be made available to the client through one or more OUT parameters.
2 A function can be used with SQL DML queries,but not the procedures..
3.A function is not suitable to use DML queries,but can be used in procedures. The use of DML queries in function is not completely restricted.
4.Exception can be handled by try-catch block in a procedure whereas try-catch block cannot be used in a function.
5. We can go for transaction management in procedure whereas we can't go in function.
6.Procedures can not be utilized in a select statement whereas function can be embedded in a select statement.
7.UDF can be used in the SQL statements anywhere in the WHERE/HAVING/SELECT section where as Stored procedures cannot be.
8.UDFs that return tables can be treated as another rowset. This can be used in JOINs with other tables.
9. Inline UDF's can be though of as views that take parameters and can be used in JOINs and other Rowsetoperations.
Liked By
Write Answer
Difference Between Procedure Vs Function in the Database
Join MindStick Community
You have need login or register for voting of answers or question.
asian fanfics
26-Jan-2019Very good article I have seen Differences between procedures and functions. Help me expand my knowledge.
hppy wheels
Anupam Mishra
07-Nov-2015The point of differences between procedure and function are as follows:
1. A function has a return type, while procedure does not have any return type.However ,If needed, the data can be made available to the client through one or more OUT parameters.
2 A function can be used with SQL DML queries,but not the procedures..